Conversation
karim-en
requested changes
Apr 15, 2026
karim-en
requested changes
Apr 27, 2026
karim-en
reviewed
Apr 27, 2026
karim-en
reviewed
Apr 27, 2026
karim-en
approved these changes
Apr 28, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the Satoshi Bridge’s Bitcoin transaction verification flows to support verify_transaction_inclusion_v2, which includes coinbase merkle proof data for stronger inclusion verification. It introduces a shared TxInclusionProof input shape and wires it through deposit/withdraw/active-UTXO-management/refund verification paths, along with test and mock light-client updates.
Changes:
- Add
TxInclusionProofand new*_v2bridge entrypoints that accept a nested proof object including coinbase proof fields. - Update the bridge’s BTC light client integration to call
verify_transaction_inclusion_v2when coinbase proof is provided, falling back to v1 otherwise. - Extend workspace tests and the mock BTC light client contract to exercise/enable the v2 verification path.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/satoshi-bridge/src/lib.rs | Introduces TxInclusionProof used by v2 APIs. |
| contracts/satoshi-bridge/src/btc_light_client/mod.rs | Adds v2 proof args + external interface and routes calls to v2 when coinbase proof exists. |
| contracts/satoshi-bridge/src/api/bridge.rs | Adds verify_deposit_v2, safe_verify_deposit_v2, verify_withdraw_v2, verify_active_utxo_management_v2; refactors legacy methods and updates refund finalize signature. |
| contracts/satoshi-bridge/src/btc_light_client/deposit.rs | Refactors deposit verification into reusable entry helpers; plumbs optional coinbase proof through verification. |
| contracts/satoshi-bridge/src/btc_light_client/withdraw.rs | Adds an internal “entry” helper to reuse logic and support v2 coinbase proof. |
| contracts/satoshi-bridge/src/btc_light_client/active_utxo_management.rs | Adds an internal “entry” helper and keeps active UTXO management verification compatible with v2 proofs. |
| contracts/satoshi-bridge/src/refund.rs | Switches refund verification to use TxInclusionProof and v2 inclusion verification; uses Base64VecU8 for tx bytes. |
| contracts/satoshi-bridge/tests/setup/context.rs | Adds v2 test helpers and updates refund helper argument shape to include nested proof. |
| contracts/satoshi-bridge/tests/test_satoshi_bridge.rs | Adds tests covering v2 deposit/safe-deposit/withdraw and a (currently non-asserting) v2 active UTXO management test. |
| contracts/mock-btc-light-client/src/lib.rs | Adds mock implementation for verify_transaction_inclusion_v2. |
| contracts/satoshi-bridge/release_notes.md | Notes the v2 inclusion verification addition for version 0.9.0. |
| contracts/satoshi-bridge/Cargo.toml | Bumps satoshi-bridge version to 0.9.0. |
| contracts/mock-btc-light-client/Cargo.toml | Bumps mock-btc-light-client version to 0.2.0. |
| Cargo.lock | Updates locked versions for the bumped crates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kiseln
approved these changes
Jun 9, 2026
kiseln
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace verify_transaction_inclusion with verify_transaction_inclusion_v2 across all bridge verification flows (deposit, withdraw, active UTXO management)
See Near-One/btc-light-client-contract#139